package com.home766.util;

import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PropertiesLoaderUtils;

import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

@SuppressWarnings({ "unchecked", "rawtypes" })
public class PropertyUtil {
	static Map<String,String> staticmap = new HashMap<String,String>();
	static {
	
		Resource resource = new ClassPathResource("/payment.properties");
		try{
		Properties systemProps = PropertiesLoaderUtils.loadProperties(resource);
		staticmap.putAll((Map)systemProps);
		}catch(Exception e)
		{
			e.printStackTrace();
		}
	}
	public static String getValue(String key){
		return staticmap.get(key);
	}
	public static Map<String,String> getValue(){
		return staticmap;
	}
}
